#ifndef MAINTAIN_BUTTON_DELEGATE_H
#define MAINTAIN_BUTTON_DELEGATE_H

#include <QItemDelegate>

class MaintainButtonDelegate : public QItemDelegate
{
    Q_OBJECT

public:
    explicit MaintainButtonDelegate(QObject *parent = 0);

    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);

signals:
    void signalButtonClicked(int nRowIdx, bool bAction=true);

public slots:
    void slotProgressFinished(int nRowIdx);

private:
    QMap<QModelIndex, QStyleOptionButton*> m_mapButton;
};

#endif // MAINTAIN_BUTTON_DELEGATE_H
